From 7ed3fe050d7f27dd615774252f20cee4c26e05da Mon Sep 17 00:00:00 2001 From: oliskoli Date: Mon, 5 Dec 2005 13:26:32 +0000 Subject: [PATCH] Only decrement internal waypt_ct if waypt_head is flushed. --- gpsbabel/waypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpsbabel/waypt.c b/gpsbabel/waypt.c index bf1af9880..ddd66e014 100644 --- a/gpsbabel/waypt.c +++ b/gpsbabel/waypt.c @@ -325,7 +325,9 @@ waypt_flush( queue *head ) QUEUE_FOR_EACH(head, elem, tmp) { waypoint *q = (waypoint *) dequeue(elem); waypt_free(q); - waypt_ct--; + if (head == &waypt_head) { + waypt_ct--; + } } } -- 2.30.2